<!--
 * @Author: your name
 * @Date: 2021-11-29 09:56:01
 * @LastEditTime: 2021-12-02 09:49:27
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\client\src\components\NavContent.vue
-->
<template>
  <div class="tab-main">
    <div
      v-for="item in data"
      :key="item.id"
      class="main-item"
      @click="handlerClick(item.id)"
    >
      <div class="main-title">
        <p class="item_title">{{ item.title }}</p>
        <p>大约{{ item.release_time }}</p>
        <p>{{ item.classify }}</p>
      </div>
      <div class="main-content">
        <div v-if="item.cover"><img :src="item.cover" alt="" /></div>
        <div>
          <span
            ><i
              class="iconfont icon-xihuan1"
              style="font-size: 14px; font-weight: bold; margin-left: 10px"
            ></i>
            {{ item.likes }}</span
          >
          ·
          <span
            ><i class="iconfont icon-xianshimima"></i> {{ item.looks }}</span
          >
          ·
          <span><i class="iconfont icon-fenxiang1"></i> {{ $t("share") }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Array,
      default: null,
      require: true,
    },
    handlerClick: {
      type: Function,
      default: null,
      require: false,
    },
  },
};
</script>

<style lang="scss" scoped>
@import "@/assets/scss/common/common.scss";
.tab-main {
  width: 100%;
  @include font_color("text-color");
}
.main-item {
  width: 100%;
  border-bottom: 1px solid;
  @include border_color("card_border_color");
  padding-bottom: 15px;
  cursor: pointer;
  .main-title {
    display: flex;
    align-items: center;
  }
  .main-content {
    display: flex;
    align-items: flex-end;
  }
}

.main-title {
  p:nth-child(1) {
    font-weight: bold;
    @include font_color("text-color");
  }
  p {
    color: #9ba7bf;
  }
  p {
    margin: 10px 10px 10px 0;
  }
}
.main-title:hover {
  p:nth-child(1) {
    color: #ff0064 !important;
  }
}
.main-content {
  img {
    width: 190px;
    height: 100px;
    margin-right: 20px;
  }
  span {
    font-size: 14px;
    margin-right: 5px;
  }
  .iconfont {
    font-size: 12px;
    color: #9ba7bf;
    margin-left: 0 !important;
  }
}
</style>
